package com.iyundao.io.mapper;

import com.iyundao.io.model.WishSubmitDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WishSubmitDetailMapper {
    @Insert({
        "insert into wishsubmitdetail (id, submitid, ",
        "giftid)",
        "values (#{id,jdbcType=INTEGER}, #{submitid,jdbcType=INTEGER}, ",
        "#{giftid,jdbcType=INTEGER})"
    })
    int insert(WishSubmitDetail record);

    @InsertProvider(type=WishSubmitDetailSqlProvider.class, method="insertSelective")
    int insertSelective(WishSubmitDetail record);

    @Select("select * from wishsubmitdetail where submitid=#{submitid,jdbcType=INTEGER}")
    List<WishSubmitDetail> selectBySubmitId(Integer submitid);

    @Delete("delete wishsubmitdetail where submitid=submitid=#{submitid,jdbcType=INTEGER}")
    int delete(Integer submitid);
}